// 项目业务请求接口
import request from './request'

// 渲染启动图接口
export function getListApi() {
  return request({
    url: '/app/home/getFirstClassify',
    method: 'GET'
  })
}
// 考试分类id /getMajor/  classify_id
export function getKaoShiApi(id) {
  return request({
    url: `/app/home/getMajor/${id}?${id}`,
    method: 'GET',
    params: { classify_id: id }
  })
}
// 获取首页的数据  /getSecondClassify/2?classify_id=2
export function getShouYeApi(id) {
  return request({
    url: `/app/home/getSecondClassify/${id}?${id}`,
    method: 'GET',
    params: { classify_id: id }
  })
}
// 获取轮播图的数据  /banner/12/4
export function getBannerApi(id) {
  return request({
    url: `/app/home/banner/${id}/4`,
    method: 'GET',
    params: { classify_id: id }
  })
}
// 搜索获取数据   classifyCourse/1?%E8%80%83&classify_id=1&title=%E8%80%83
export function getSearchApi(params) {
  return request({
    url: `/app/home/classifyCourse/1?%E8%80%83&classify_id=${params.classify_id}&title=${params.title}`,
    method: 'GET',
    params
  })
}
// 获取时间的函数  operateConfig
export function getBannerTimerApi() {
  return request({
    url: `/app/home/operateConfig`,
    method: 'GET'
  })
}
// 渲染精选数据 /marketingCourse/54?classify_id=54
export function getShouYeListApi(id) {
  return request({
    url: `/app/home/marketingCourse/${id}?${id}`,
    method: 'GET',
    params: { classify_id: id }
  })
}
// 渲染精选下面部分 classifyCourse/50?page=1&limit=15&classify_id=50
export function getShouYeJXuanApi(id) {
  return request({
    url: `/app/home/classifyCourse/${id}?page=1&limit=15&classify_id=${id}`,
    method: 'GET',
    params: { classify_id: id }
  })
}

// 精选   /home/recommendCourse/1?classify_id=1
export function getShouYeJXApi(id) {
  return request({
    url: `/app/home/recommendCourse/${id}?${id}`,
    method: 'GET',
    params: { classify_id: id }
  })
}
// 详情 courseInfo/basis_id=1194/st=0?basis_id=1194&st=0&channel=
export function getShouYeXQApi(id) {
  return request({
    url: `/app/courseInfo/basis_id=${id}/st=1?basis_id=${id}&st=1&channel=`,
    method: 'GET',
    params: { basis_id: id },
    status: true
  })
}
// 详情评价  getAllCommentByType
export function getShouYeXQPJApi(id) {
  return request({
    url: `/app/getAllCommentByType`,
    method: 'POST',
    data: { course_id: id, type: 1 }
  })
}
// 详情 老师app/teacherinfo
export function getDXIANGQXQApi(id) {
  return request({
    url: `/app/teacherinfo`,
    method: 'POST',
    data: { id }
  })
}
// 详情 老师课程 teacher/newCourseList
export function getDXIANGQXQNEWApi(id) {
  return request({
    url: `/app/teacher/newCourseList`,
    method: 'POST',
    data: { id }
  })
}
// 全部老师 teacherClassify
export function getALLXIANGQXQNEWApi() {
  return request({
    url: `/app/teacherClassify`,
    method: 'GET'
  })
}
// 全部老师 teacher
export function getALLListXIANGQXQNEWApi(id) {
  return request({
    url: `/app/teacher`,
    method: 'POST',
    data: {
      city_id: 0,
      is_pc: 1,
      limit: 15,
      province_id: 0,
      teacher_classfiy: id
    }
  })
}
// 图片验证码 getImgCode
export function getImgCodeApi() {
  return request({
    url: `/app/getImgCode`,
    method: 'GET'
  })
}
// 用户注册 getsmscode
export function getZCApi(data) {
  return request({
    url: `/app/getsmscode`,
    method: 'POST',
    data
  })
}
// 登录 login
export function getLoginApi(data) {
  return request({
    url: `/app/login`,
    method: 'POST',
    data
  })
}
// 验证两次密码是否一样以及设置密码 getpassword
export function setPasswordApi(data) {
  return request({
    url: `/app/getpassword`,
    method: 'POST',
    data
  })
}
// 添加收藏 collect
export function getcollecttttApi(data) {
  return request({
    url: `/app/collect`,
    method: 'POST',
    data
  })
}
// 获取收藏 collect
export function getcollectApi() {
  return request({
    url: `/app/collect`,
    method: 'GET'
  })
}
// 二维码 getWechatWebSign?url=https:%2F%2Fwap.lexuemiao.com%2Fdetail%3Fbasis_id%3D1475
export function getSOUCANGtApi(id) {
  return request({
    url: `/app/getWechatWebSign?url=https:%2F%2Fwap.lexuemiao.com%2Fdetail%3Fbasis_id%3D${id}`,
    method: 'GET'
  })
}
// 微信二维码 /getWechatInfo/1194?id=1194
export function getcollecterweimaApi(id) {
  return request({
    url: `/app/getWechatInfo/1194?id=${id}`,
    method: 'GET',
    params: { id: id }
  })
}
// 详情课程安排 courseInfo/orderByChapterList/1475?course_id=1475
export function getcourseInfoApi(id) {
  return request({
    url: `/app/courseInfo/orderByChapterList/1475?course_id=${id}`,
    method: 'GET',
    params: { course_id: id }
  })
}
// 点击头像获取个人信息 showone/id=434175?id=434175
export function getshowoneApi(id) {
  return request({
    url: `/app/showone/id=${id}?id=${id}`,
    method: 'GET',
    params: { id: id },
    status: true
  })
}
// 上课短信通知
export function smsMsgApi(a) {
  return request({
    url: `/app/msgNotice?is_msg_notice=${a}`,
    method: 'GET',
    status: true
  })
}

// 订单接口
export function getOredrApi(data) {
  return request({
    url: `/order`,
    method: 'post',
    data,
    status: true
  })
}

// 确认订单
export function okOrdersApi(data) {
  return request({
    url: `/order/shopinfo`,
    method: 'post',
    data,
    status: true
  })
}
// 关于我们
export function guanyuwomenApi() {
  return request({
    url: `app/about/type=1`,
    method: 'get',
    status: true
  })
}
// 报考专业 修改昵称
export function editUserNameApi(data) {
  return request({
    url: `/app/updateInfo`,
    method: 'PUT',
    data,
    status: true
  })
}

// 验证码接口
export function getSmsCodeApi(data) {
  return request({
    url: '/app/getsmscode',
    method: 'post',
    data
  })
}
// 我的课17日课程 myCourse/weekList?1654963200today_time&time=1654963200&today_time=1655395200
export function getmyCourseApi(params) {
  return request({
    url: '/app/myCourse/weekList?1654963200today_time&time=1654963200&today_time=1655395200',
    method: 'GET',
    params
  })
}

// 获取正在学习的课程
export function zhengzaixuexiApi() {
  return request({
    url: '/app/myCourse/studyCourseList',
    method: 'GET'
  })
}
// 我的课 课程安排
export function kecheng(is_free = '', a = '') {
  return request({
    url: `/app/myCourse/type=0?type=0&is_free=${is_free}&study_status=${a}`,
    method: 'GET'
  })
}
// 获取去个人信息
export function getUserInfoApi(id) {
  return request({
    url: `/app/showone/id=${id}?id=${id}`,
    method: 'get',
    status: true
  })
}

// 验证码
export function getSmsCodeyzmApi(data) {
  return request({
    url: '/app/getsmscode',
    method: 'post',
    data
  })
}

// 修改手机号
export function setMobileApi(data) {
  return request({
    url: '/app/verifySmscode',
    method: 'POST',
    data,
    status: true
  })
}
//确定 修改手机号
export function setMobileApi2(data) {
  return request({
    url: '/app/modifyMobile',
    method: 'post',
    data,
    status: true
  })
}

// 消息通知
export function notifyApi(message_classify) {
  return request({
    url: `/app/message/getMessage/message_classify=${message_classify}?message_classify=${message_classify}`,
    method: 'get',
    status: true
  })
}

// 获取地址
export function getAddressApi() {
  return request({
    url: '/app/address',
    method: 'get',
    status: true
  })
}

// 删除地址
export function delAddressApi(id) {
  return request({
    url: `/app/address/${id}`,
    method: 'delete',
    status: true
  })
}
// 新建地址
export function addressApi(data) {
  return request({
    url: '/app/address',
    method: 'post',
    data,
    status: true
  })
}
// 课程  app/myCourse/type=0?type=0&is_free=&study_status=
export function addlechnegaApi(a, b) {
  return request({
    url: `/app/myCourse/type=0?type=0&is_free=${a}&study_status=${b}`,
    method: 'get'
  })
}

// 选择学校
export function xaunzexuexiaoApi(data) {
  return request({
    url: '/study/getCollege',
    method: 'post',
    data,
    status: true
  })
}
